/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dkvklocka;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author max.gabrielsson
 */
public class DkvPropUtils {
    
    public static String getProperty(String propName) {
        
        FileInputStream fs;
        

        try {
           fs = new FileInputStream("dkvklocka.properties");
        } catch (FileNotFoundException e) {
            fs = null;
            return "";
        }

        Properties prop = new Properties();
        
        try {
            prop.load(fs);
        } catch (IOException e) {
            System.out.println(e);
        }
        
        return prop.getProperty(propName);
    }
    
    public static String getProperty(String propName, String defaultString){
        
        return getProperty(propName)==null?defaultString:getProperty(propName);
    }
    
}
